<?php 

namespace app\admin\model;
use think\Model;

class blog extends model{
	protected $insert = ['abstract'];
	protected function setAbstractAttr($value){
			$subject = strip_tags($value);//去除html标签
			$pattern = '/\s/';//去除空白
			$content = preg_replace($pattern, '', $subject);      
			return mb_substr($content, 0, 300);//截取100个汉字
		}

}


 ?>